import os
from datetime import timedelta


class Config:
    SECRET_KEY = os.environ.get("SECRET_KEY") or "dev-key-please-change-in-production"
    SQLALCHEMY_DATABASE_URI = (
        os.environ.get("DATABASE_URL")
        or "mysql+pymysql://root:bk6gRK3C@sh-cynosdbmysql-grp-4yne912y.sql.tencentcdb.com:27612/flask_demo"
    )
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY") or "jwt-secret-key"
    JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=24)
    UPLOAD_FOLDER = "uploads"
    MAX_CONTENT_LENGTH = 16 * 1024 * 1024  # 16MB max file size

    # 微信小程序配置
    WX_APPID = "wx1ee4e259cf655bd0"  # 请替换为你的小程序 APPID
    WX_SECRET = "5543326a5dc155a9beca07e74f29c591"  # 请替换为你的小程序 SECRET

    WX_ENV_ID = "prod-7gx9za9x1b9e081b"
    WX_CLOUD_ENV = WX_ENV_ID  # 用于对象存储的云环境ID
    # WX_AUTH_TOKEN
